package com.sunmnet.j2ee.entity.powerdb.designer;

import com.sunmnet.j2ee.entity.base.BaseAutoEntity;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * Created by 蔡岳衡 on 2016/7/28.
 */

@Entity
@Table(name="pdm_db_conn_info")
@DynamicInsert(true)
@DynamicUpdate(true)
public class DbConnInfo extends BaseAutoEntity implements Serializable{

	private static final long serialVersionUID = 7814916185113806197L;

	private int port;
	private String name;
	private String remark;
	private String username;
	private String password;
	private Short status;
	private Short type;
	private Short charset;
	private String dbName;
	private String url;
	private Long createAccountId;
	private Long modifyAccountId;
	private String ip;

	@Column(name = "ip")
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	@Column(name="port")
	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}

	@Column(name="name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name="remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name="username")
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name="password")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name="status")
	public Short getStatus() {
		return status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}

	@Column(name="type")
	public Short getType() {
		return type;
	}

	public void setType(Short type) {
		this.type = type;
	}

	@Column(name="charset")
	public Short getCharset() {
		return charset;
	}

	public void setCharset(Short charset) {
		this.charset = charset;
	}

	@Column(name="db_name")
	public String getDbName() {
		return dbName;
	}

	public void setDbName(String dbName) {
		this.dbName = dbName;
	}

	@Column(name="url")
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Column(name="create_account_id")
	public Long getCreateAccountId() {
		return createAccountId;
	}

	public void setCreateAccountId(Long createAccountId) {
		this.createAccountId = createAccountId;
	}

	@Column(name="modify_account_id")
	public Long getModifyAccountId() {
		return modifyAccountId;
	}

	public void setModifyAccountId(Long modifyAccountId) {
		this.modifyAccountId = modifyAccountId;
	}

	@Override
	public String toString() {
		return new ReflectionToStringBuilder(
				this,
				ToStringStyle.MULTI_LINE_STYLE)
				.toString();
	}
}
